<include file="../Public/_header.html" />

<div class="so_main">
  	<div class="page_tit">地点：{$popular['title']} -- 下的店铺</div>
  	
	<div class="Toolbar_inbox">
		<a href="{:U('/AreaPopular/addStore',array('popu_id'=>$popular['popu_id']))}" class="btn_a"  title="在该点下关联新店铺" ><span>添加新店铺</span></a>
    	<a href="javascript:void(0);" class="btn_a" onclick="del();" title="删除所选择的店铺与当前地点的关联" ><span>删除店铺</span></a>
  	</div>
  
  	<div class="list">
	  	<table id="popular_list" width="100%" border="0" cellspacing="0" cellpadding="0">
		  	<tr>
		    	<th style="width:30px;">
			        <input type="checkbox" id="checkbox_handle" onclick="table_checkAll(this)" value="0">
			        <label for="checkbox"></label>
		    	</th>
		    	<th class="line_l">店名</th>
		    	<th class="line_l" style="width:30px;">
					<input type="checkbox" id="checkbox_handle" onclick="table_checkAll(this)" value="0">
			        <label for="checkbox"></label>
				</th>
		    	<th class="line_l">店名</th>
		  	</tr>
		  	<tr overstyle='on'>
		  	<volist id="vo" name="bsubpage['data']">
		    	<php>if($i/3==1){</php>
		    	</tr>
		    	<tr overstyle='on'>
		    	<php>}</php>
		        <td id="popular_{$vo.id}">
		        <input type="checkbox" name="checkbox" id="checkbox2" onclick="table_checkon(this)" value="{$vo.id}"></td>
		        <td>{$vo.title}</td>
			
		  	</volist>
		  	</tr>
	  	</table>
  	</div>
  	<div class="Toolbar_inbox">
    	<div class="page_box">{$bsubpage['html']}</div>
  	</div>
</div>
<div class="clear"></div>

<script>
    //鼠标移动表格效果
    $(document).ready(function(){
    	table_init();
    });
    
    //删除分类
    function del(aid) {
        aid = aid ? aid : table_getChecked();
        aid = aid.toString();
        if(aid == '') return false;
		if(!confirm('确定添加么？')){
				return;
		}
        //提交删除
        $.post( "{:U('/AreaPopular/delStore',array('popu_id'=>$popular['popu_id']))}", {ids:aid}, function(res){
        	//alert(res);
	        if(res == '1') {
		        aid = aid.split(',');
		        //$.each(aid, function(i,n){
		       	k_page_redirect( "{:U('/AreaPopular/showStore',array('popu_id'=>$popular['popu_id']))}" );
		        //});
	            ui.success('添加成功');
	        }else {
	        	ui.success('添加失败');
	        }
        });
    }
    
</script>


<include file="../Public/_footer.html" />